﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eGrocery.ProductDAL
{
    public class ProductDAL:eGrocery.BaseDAL.BaseDAL<eGrocery.ProductEntity.Product>
    {
        public override ProductEntity.Product SaveObject(string userName, ProductEntity.Product tObject)
        {
            try
            {
                GetNewDBHelper();
                dbHelper.AddParameter("@Product_Name", tObject.ProductName);
                dbHelper.AddParameter("@Product_Desc", tObject.ProductDesc);
                dbHelper.AddParameter("@Product_Price", tObject.ProductPrice);
                dbHelper.AddParameter("@Product_Category", tObject.ProductCategory);
                dbHelper.AddParameter("@Product_Owner", tObject.ProductOwner);
                dbHelper.AddParameter("@IsLive", tObject.IsAlive);
                dbHelper.ExecuteNonQuery("USP_INS_UPDATE_PRODUCT", System.Data.CommandType.StoredProcedure, System.Data.ConnectionState.Closed);
            }
            catch (Exception)
            {

                ////throw;
            }
            return tObject;
            //throw new NotImplementedException();
        }
        public override bool DeleteObject(string userName, ProductEntity.Product tObject)
        {
            throw new NotImplementedException();
        }
        public override List<ProductEntity.Product> GetObjectList(string userName, DateTime fromDate, DateTime toDate)
        {
            throw new NotImplementedException();
        }
        public override List<ProductEntity.Product> SearchObject(string userName, string SearchText)
        {
            throw new NotImplementedException();
        }
    }
}
